<?php if (!empty($cities)) :?>
	<ul class="list cities-list clearfix">
		<?php 
			$count =0;		
			foreach ($cities as $city):
		?>
			<?php $class = (!empty($this->request->params['named']['city']) && $this->request->params['named']['city'] == $city['City']['slug']) ? ' class="active"' : null; ?>
			<li <?php echo $class;?>><?php echo $this->Html->link($city['City']['name'], array('controller' => 'projects', 'action' => 'index', 'admin' => false, 'city' => $city['City']['slug'], 'type' => 'home'), array('title' => $city['City']['name']));?>
				<?php if($city['City']['project_count']):?>
					<span class="count-block"><?php echo $this->Html->cInt(count($city['Project'])); ?></span>
				<?php 
					$count +=$city['City']['project_count'];
				endif; ?>
			</li>
		<?php endforeach;?>
	</ul>
	<?php $class = (!empty($this->request->params['named']['city']) && $this->request->params['named']['city'] == 'all') ? ' class="active"' : null; ?>
	<div class="clearfix">
		<p class="all-cities grid_right"><?php echo $this->Html->link(__l('All'), array('controller' => 'projects', 'action' => 'index', 'type' => 'home'), array('title' => __l('All')));?><span class="count-block"><?php echo $this->Html->cInt($count); ?></span></p>
	</div>
<?php endif;?>